home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / NeXTmj / Source / GameTile.h < prev    next >
C/C++ Source or Header  |  1991-03-05  |  2KB  |  95 lines

  1.  
  2. /*
  3.  * This is the base class for tiles that are
  4.  *    used on the game board.
  5.  *
  6.  $Author$
  7.  $Header$
  8.  *
  9.  $Log$
  10.  */
  11.  
  12. #import    "Tile.h"
  13.  
  14. extern "Objective-C" {
  15. #import    <objc/objc.h>
  16. }
  17.  
  18.  
  19.                                                 // This enumerated type is used to
  20.                                                 //    identify tiles by type.
  21.                                                 // These types are used to identify
  22.                                                 //    that two peices are equal.  If equal
  23.                                                 //    they can be removed from the board.
  24.     typedef enum {    EAST_WIND,        SOUTH_WIND,        WEST_WIND,        NORTH_WIND,
  25.                     
  26.                     SEASON,            FLOWER,
  27.                     
  28.                     CIRCLE_1,        CIRCLE_2,        CIRCLE_3,        CIRCLE_4,
  29.                     CIRCLE_5,        CIRCLE_6,        CIRCLE_7,        CIRCLE_8,
  30.                     CIRCLE_9,
  31.                     
  32.                     BAMBOO_1,        BAMBOO_2,        BAMBOO_3,        BAMBOO_4,
  33.                     BAMBOO_5,        BAMBOO_6,        BAMBOO_7,        BAMBOO_8,
  34.                     BAMBOO_9,
  35.                     
  36.                     CHARACTER_1,    CHARACTER_2,    CHARACTER_3,    CHARACTER_4,
  37.                     CHARACTER_5,    CHARACTER_6,    CHARACTER_7,    CHARACTER_8,
  38.                     CHARACTER_9,
  39.                     
  40.                     RED,            WHITE,            GREEN
  41.     } TILE_TYPE;
  42.                     
  43.                     
  44. class GameTile : public Tile {
  45.  
  46. private:
  47.                                                 // This is a flag which indicates wheather
  48.                                                 //    the tile has been selected.  If a tile
  49.                                                 //    is selected it's image is shown
  50.                                                 //    in reverse highlighting.
  51.     BOOL        selected;
  52. public:
  53.     BOOL        isSelected( void );
  54.     void        setSelected( BOOL );
  55.  
  56. protected:
  57.                                                 // This variable holds the tile's type.  It
  58.                                                 //    is assigned in the constructor of a
  59.                                                 //    a subclass.
  60.     TILE_TYPE    my_tile_type;
  61. public:
  62.     TILE_TYPE    tileType( void );
  63.     BOOL        isTileType( TILE_TYPE aType );
  64.     
  65.  
  66. private:
  67.                                                 // Those tiles then determine if they are
  68.                                                 //    selectable.
  69.     BOOL    selectable;
  70. public:
  71.     BOOL    isSelectable( void );    
  72.     void    setSelectable( BOOL );
  73.  
  74. private:
  75.                                                 // A Tile Removed from the Game Board
  76.                                                 //    is not drawn on the board and doesn't
  77.                                                 //    prohibit the surrounding Tiles from
  78.                                                 //    being selectable.
  79.     BOOL    removed;
  80. public:
  81.     BOOL    isRemoved( void );
  82.     void    setRemoved( BOOL );
  83.  
  84. public:
  85.                                                 // Game tiles highlight themselves if
  86.                                                 //    they are selected.
  87.     virtual void    drawImage( NXPoint );
  88.  
  89.  
  90. public:
  91.     GameTile( void );
  92.  
  93. };
  94.  
  95.